#include "QtRoboRace.h"
#include "QtMapSelector.h"



QtRoboRace::QtRoboRace(QWidget * parent, Qt::WFlags flags): QMainWindow(parent, flags), game(0), factory(0)
{
	ui.setupUi(this);
	

	factory = new QtPresentationFactory(this);
	game = new Game(factory);

	setCentralWidget(factory);

}

QtRoboRace::~QtRoboRace()
{

}

void QtRoboRace::on_actionStart_activated()
{
	if (!game)
	{
		factory = new QtPresentationFactory(this);
		game = new Game(factory);

		setCentralWidget(factory);
	}

	game->Start();
}

void QtRoboRace::on_actionStop_activated()
{
	if (game)
	{
		qDebug("stop");
	}
}
